export default {
  data () {
    return {
      menuList: []
    }
  },
  methods: {
    // 退出功能
    async logout () {
      await this.$confirm('你是否确定退出?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
      this.$message({
        type: 'success',
        message: '退出成功!'
      })
      localStorage.removeItem('token')
      this.$router.push('/login')
    }
  },
  async created () {
    // 获取菜单
    const res = await this.axios.get('menus')
    this.menuList = res.data.data
  }
}
